<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <link href="assets/css/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="assets/css/font-awesome.min.css" />
  <!--[if IE 7]>
    <link rel="stylesheet" href="assets/css/font-awesome-ie7.min.css" />
  <![endif]-->
  <link rel="stylesheet" href="assets/css/ace.min.css" />
  <link rel="stylesheet" href="css/style.css"/>
    <script type="text/javascript" src="js/vue.min.js"></script>
    <script type="text/javascript" src="js/axios.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
<title>评价详细</title>
</head>

<body>
<div id="app">
<div class="page-content">
 <div class="Evaluation_list">
  <table class="table table-striped table-bordered table-hover">
   <thead>
    <tr><th>序号</th><th>订单编号</th><th>供应商名称</th><th>油品</th><th>服务</th><th>其他</th><th>总分</th></tr>
  
   </thead>
   <tbody>
   <tr v-for="i in zData">
       <td>{{i.o_id}}</td>
       <td><a href="javascript:void(0)" @click="openOrderInfo(i)">{{i.o_number}}</a></td>
       <td>{{i.supplier}}</td>
       <td>{{i.oil}}</td>
       <td>{{i.serve}}</td>
       <td>{{i.other}}</td>
       <td>{{(((i.oil * 1) + (i.serve * 1) + (i.other * 1)) / 3).toFixed(2)}}</td>
   </tr>
   </tbody>
  </table>
   <div class="page_style">
       <div class="block">
           <span class="demonstration">完整功能</span>
           <el-pagination
                   @size-change="handleSizeChange"
                   @current-change="handleCurrentChange"
                   :current-page="page"
                   :page-sizes="[10, 15, 20]"
                   :pageSize="10"
                   layout="total, sizes, prev, pager, next, jumper"
                   :total=total>
           </el-pagination>
       </div>
  </div>
 </div>
</div>
</div>
<!--[if !IE]> -->
		<script src="assets/js/jquery.min.js"></script>
		<!-- <![endif]-->
		<!--[if IE]>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<![endif]-->
		<!--[if !IE]> -->
		<script type="text/javascript">
			window.jQuery || document.write("<script src='assets/js/jquery-2.0.3.min.js'>"+"<"+"/script>");
		</script>
		<!-- <![endif]-->
		<!--[if IE]>
<script type="text/javascript">
 window.jQuery || document.write("<script src='assets/js/jquery-1.10.2.min.js'>"+"<"+"/script>");
</script>
<![endif]-->
	<script type="text/javascript">
        if("ontouchend" in document) document.write("<script src='assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
    </script>
	<script src="assets/js/bootstrap.min.js"></script>
    <script src="assets/layer/layer.js" type="text/javascript"></script>
    <script src="assets/laydate/laydate.js"  type="text/javascript"></script>
<script type="text/javascript">
 //弹出一个iframe层
$('.Numbering').on('click', function(){
    layer.open({
        type: 2,
        title: '供应商订单信息',
        maxmin: true,
        shadeClose: true, //点击遮罩关闭层
        area : ['980px' , '400px'],
        content: '订单信息.html'
    });
});
</script>
<script>
    new Vue({
        el:"#app",
        data:{
            //总数据
            zData:[],

            //搜索对象
            searchObj:{
                o_type:'已完结',
                project_name:'',
                o_number:'',
                prime_date:''
            },
            //当前页数
            page:1,
            //每页显示数
            pageSize:10,
            //总条目数
            total:0,


        },
        methods:{
            getInfo(){
                axios.get("orders/已完结/"+(this.page-1)*this.pageSize+"/"+this.pageSize+"/ordersType.do").then(dt => {
                    this.zData = [];
                    for (let i = 0; i < dt.data.length; i++) {
                        let comData = {
                            o_id: dt.data[i].o_id,
                            project_name: dt.data[i].project_name,
                            o_number: dt.data[i].o_number,
                            prime_date: dt.data[i].prime_date,
                            place: dt.data[i].place,
                            boat_name: dt.data[i].boat_name,
                            supplier: dt.data[i].supplier,
                            date: dt.data[i].date,
                            oil:dt.data[i].oil,
                            serve: dt.data[i].serve,
                            other: dt.data[i].other,
                            breed: dt.data[i].breed.split(","),
                            price: dt.data[i].price.split(","),
                            purchase_quantity: dt.data[i].purchase_quantity.split(","),
                            total: 0
                        };
                        for (let j = 0; j < comData.price.length; j++) {
                            comData.total += parseFloat(comData.price[j]) * parseFloat(comData.purchase_quantity[j]);
                        }
                        this.zData.push(comData);
                    }
                    console.log(this.zData);
                })
            },
            handleSizeChange(val) {
                this.pageSize=val
                this.getInfo()
            },
            handleCurrentChange(val) {
                this.page=val
                this.getInfo()
            },
            openOrderInfo(i){
                localStorage.setItem("data", JSON.stringify(i));
                layer.open({
                    type: 2,
                    title: '供应商订单信息',
                    maxmin: true,
                    shadeClose: true,
                    area: ['980px', '400px'],
                    content: '订单信息.html'
                });
            }

        },
        mounted(){
            axios.get("orders/已完结/total.do").then(dt =>{
                this.total=dt.data
            })
            this.getInfo();
        }
    })
</script>
</body>
</html>
